import pandas as pd
import json

with open("data/wb_economy.json") as f:
    leco = json.load(f)

nm_eco = [d["name"] for d in leco[1]]
cd_eco = [d["id"] for d in leco[1]]
cd_eco = [d["region"]["id"] for d in leco[1]]

df_eco = pd.DataFrame({"name":nm_eco,"id": cd_eco, "region_code":cd_eco})
df_eco.to_csv("data/wb_economy.csv",index=False)